<?php 
/**
 * [PHPFOX_HEADER]
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond Benc
 * @package  		Module_Feed
 * @version 		$Id: display.html.php 2284 2011-02-01 15:58:18Z Raymond_Benc $
 */
 
defined('PHPFOX') or exit('NO DICE!'); 

?>
				<div class="global_attachment_holder_section" id="global_attachment_photo">
					<div><input type="hidden" name="val[group_id]" value="{if isset($aFeedCallback.item_id)}{$aFeedCallback.item_id}{else}0{/if}" /></div>			
					<div><input type="hidden" name="val[action]" value="upload_photo_via_share" /></div>
					{if Phpfox::getLib('request')->isIOS()}
							<input type="button" name="FiledataOriginal" id="FiledataOriginal" value="Choose photo" style="display:none;">
						{else}
                                                        <div class="extra_info">
								{phrase var='photo.select_a_photo_to_attach'}
							</div>	
							<div id="divFileInput">
                                                            <input type="file" name="image[]" id="global_attachment_photo_file_input" value="" onchange="$bButtonSubmitActive = true; $('.activity_feed_form_button .button').removeClass('button_not_active');readURL(this);" />
                                                            
                                                            <div style="max-height: 150px;overflow: hidden;display: none;" id="post_global_image_preview">
                                                                <img width="150px" src="http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif"/>
                                                                
                                                                <div id="post_global_image_preview_album">
                                                                    <select name="val[photo_album_id]">
                                                                        <option value="">Select a Album</option>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                        </div>
												
					{/if}
        <div class="feed_post_cancel" style="text-align: right;">
            <a href="#" onclick="$Core.resetActivityFeedForm();return false;">Cancel</a>
        </div>
				</div>		
                                {literal}
                                <script type="text/javascript">
                                    function readURL(input) {
                                        if (input.files && input.files[0]) {
                                            var reader = new FileReader();

                                            reader.onload = function (e) {
                                                $('#post_global_image_preview img')
                                                    .attr('src', e.target.result);
                                            };

                                            reader.readAsDataURL(input.files[0]);
                                            $("#post_global_image_preview").show();
                                        }
                                    }
                                </script>
                                {/literal}